home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_10
/
9n10074a
< prev
next >
Wrap
Text File
|
1991-08-20
|
636b
|
32 lines
/*
* memorg.c
* Jerzy Tomasik, 12-Jul-1991
* Data memory organization in a typical
* C program
*/
#include <stdlib.h>
#include <stdio.h>
static char str1[] = "This is initialized, static";
static char str2[2048];
char str3[4096];
int main(void)
{
char auto_str[512];
char *heap_str;
int dummy;
heap_str = malloc(512);
printf("str1 %Fp\n", str1);
printf("str2 %Fp\n", str2);
printf("str3 %Fp\n", str3);
printf("auto_str %Fp\n", auto_str);
printf("heap_str %Fp\n", heap_str);
free(heap_str);
return(0);
}